import mitt from 'mitt'
import { ElMessage } from 'element-plus'

const emitter = mitt<Record<string, string>>()

emitter.on('apiError', async (msg: string) => {
    ElMessage({
        message: msg,
        type: 'error',
        duration: 3000,
        showClose: true,
    })
})